﻿namespace InkType.ViewModel

open System
open System.Windows
open System.Windows.Data
open System.Windows.Input

#nowarn "62"

module Command =
    let Relay execute =
        { new ICommand with
            [<CLIEvent>] member x.CanExecuteChanged = Event.empty
            member x.CanExecute _ = true
            member x.Execute _ = execute () }

    let RelayP execute =
        { new ICommand with
            [<CLIEvent>] member x.CanExecuteChanged = Event.empty
            member x.CanExecute p = true
            member x.Execute p = execute (p :?> 'p) }

